/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package planner_exercise;

/**
 *
 * @author Propietario
 */
public class Predicates {
    static String[] diffTypes={"ON-STATION","IN-FRONT-OF","FREE","FREE-LOCOMOTIVE","TOWED","USED-RAILWAYS","LOADED","EMPTY"};
    String type;
    String obj1;
    String obj2;
    String name;
    int railNum;
    
    public Predicates(String type){
        this.type= type;
        this.name=namePredicate(type);        
    }

    public Predicates(String type, String obj1){
        this.obj1=obj1;
        this.type= type;
        this.name=namePredicate(type,obj1);        
    }
    public Predicates(String type, String obj1,String obj2){
        this.obj1=obj1;
        this.obj2=obj2;
        this.type=type;
        this.name=namePredicate(type,obj1,obj2); 
    }
    public Predicates(String type, int railNum){
        this.railNum=railNum; 
        this.type=type;
        this.name=namePredicate(type,railNum);
    }

    /**
     *
     * @param type
     * @return
     */
    public String namePredicate(String type){
        this.name= type;
        return name;
    }
    public String namePredicate(String type, String obj1){
        this.name= type+"("+obj1+")";
        return name;
    }
    public String namePredicate(String type, String obj1,String obj2){
        this.name= type+"("+obj1+","+obj2+")";
        return name;
    }
    public String namePredicate(String type, int railNum){
        this.name= type+"("+Integer.toString(railNum)+")";
        return name;
    }
}
